package edu.hitsz.factory.enemyFactory;

import edu.hitsz.aircraft.enemy.AbstractEnemy;
import edu.hitsz.aircraft.enemy.MobEnemy;
import edu.hitsz.application.ImageManager;
import edu.hitsz.application.Main;

public class MobEnemyFactory extends EnemyFactory {

    public MobEnemyFactory() {
        super();
    }

    @Override
    public void setBaseValue() {
        this.baseHp=30;
        this.baseSpeedX=0;
        this.baseSpeedY=8;
    }

    @Override
    public void setEasyMode() {
        hp=baseHp;
        speedX=baseSpeedX;
        speedY=baseSpeedY;
    }

    @Override
    public void setNormalMode() {
        hp=baseHp;
        speedX=baseSpeedX;
        speedY= (int) (baseSpeedY*1.1);
    }

    @Override
    public void setHardMode() {
        hp= (int) (baseHp*1.5);
        speedX=baseSpeedX;
        speedY= (int) (baseSpeedY*1.3);
    }

    @Override
    public AbstractEnemy createEnemy() {
        return new MobEnemy(
                (int) (Math.random() * (Main.WINDOW_WIDTH - ImageManager.MOB_ENEMY_IMAGE.getWidth())),
                (int) (Math.random() * Main.WINDOW_HEIGHT * 0.05),
                speedX,
                speedY,
                hp
        );
    }
}
